import * as types from './types'
import {capexProcessSchedule} from "./types";

export default {
    [types.TOKEN]: (state, data) => {
        state.token = data
    },
    [types.loginOut]: (state, data) => {
        localStorage.removeItem('ziyunBackstageInfo');
        localStorage.removeItem('ziyunUserAuthority');
        localStorage.removeItem('ziyunAuthority');
        localStorage.removeItem('isAdmin');
        state.userInfo = data;
        state.userAuthority = false;
        state.userAuthorityObj = data;
    },
    [types.loadingPage]: (state, bl) => {
        if (bl) {
            state[types.loadingPage]++
        }else{
            if (state[types.loadingPage] > 0) {
                state[types.loadingPage]--
            }
        }

    },
    [types.oneClickImportSelectedDevices]: (state, arr) => {
        state[types.oneClickImportSelectedDevices] = arr;
    },
    [types.dncTreeSelectedItem]: (state, str) => {
        state[types.dncTreeSelectedItem] = str;
    },
    [types.Title]: (state, data) => {
        state.title = data
    },
    [types.menuScale]: (state, data) => {
        state.menuScale = data
    },
    [types.capex]: (state, data) => {
        state.capex = data
    },
    [types.fullScreenState]: (state, data) => {
        state.fullScreenState = data
    },
    [types.capexProcessSchedule]: (state, data) => {
        state.capexProcessSchedule = data
    },
}
